From: Florian Müllner Date: Sat, 26 Apr 2014 14:17:24 +0000 (+0200) Subject: workspaceThumbnails: Move to primary monitor first when creating workspace X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2499 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c7306449aeb1568af411f8142977b73017be35c7;p=gnome-shell.git workspaceThumbnails: Move to primary monitor first when creating workspace When dragging a window preview from a non-primary monitor onto a workspace thumbnail, the window is moved to the primery monitor first before changing its workspace. However when dragging the window between thumbnails to create a new workspace, it is kept on its current monitor instead. This is not only inconsistent, but outright confusing with the default 'workspaces-only-on-primary' setting, as the newly created workspace is immediately removed again. https://bugzilla.gnome.org/show_bug.cgi?id=683819 --- diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js index 1eb843dc9..b1bc7cb49 100644 --- a/js/ui/workspaceThumbnail.js +++ b/js/ui/workspaceThumbnail.js @@ -826,10 +826,14 @@ const ThumbnailsBox = new Lang.Class({ window.change_workspace_by_index(window.get_workspace().index() + 1, true); }); - if (isWindow) + if (isWindow) { // ... and bam, a workspace, good as new. + // Move the window to our monitor first if necessary. + let thumbMonitor = this._thumbnails[newWorkspaceIndex].monitorIndex; + if (source.metaWindow.get_monitor() != thumbMonitor) + source.metaWindow.move_to_monitor(thumbMonitor); source.metaWindow.change_workspace_by_index(newWorkspaceIndex, true); - else if (source.shellWorkspaceLaunch) { + } else if (source.shellWorkspaceLaunch) { source.shellWorkspaceLaunch({ workspace: newWorkspaceIndex, timestamp: time }); // This new workspace will be automatically removed if the application fails